a11y: Add a test for label properties
authorMatthias Clasen <mclasen@redhat.com>
Tue, 20 Oct 2020 04:24:26 +0000 (00:24 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 20 Oct 2020 04:25:39 +0000 (00:25 -0400)
Now that we set the label property, we should test it too.

testsuite/a11y/label.c

index 1faacaecb5237f9998d865a8c4cca5fd5957151a..3eba936bdf316316456d89cae6eb099854406e25 100644 (file)
@@ -44,6 +44,22 @@ label_relations (void)
   g_object_unref (label2);
 }
 
+static void
+label_properties (void)
+{
+  GtkWidget *label = gtk_label_new ("a");
+
+  g_object_ref_sink (label);
+
+  gtk_test_accessible_assert_property (label, GTK_ACCESSIBLE_PROPERTY_LABEL, "a");
+
+  gtk_label_set_label (GTK_LABEL (label), "b");
+
+  gtk_test_accessible_assert_property (label, GTK_ACCESSIBLE_PROPERTY_LABEL, "b");
+
+  g_object_unref (label);
+}
+
 int
 main (int argc, char *argv[])
 {
@@ -51,6 +67,7 @@ main (int argc, char *argv[])
 
   g_test_add_func ("/a11y/label/role", label_role);
   g_test_add_func ("/a11y/label/relations", label_relations);
+  g_test_add_func ("/a11y/label/properties", label_properties);
 
   return g_test_run ();
 }